/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package app.Persistencia;

import app.Modelo.Empleado;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

/**
 *
 * @author Satellite
 */
public class Metodos {
 
    
     public void  GuaradarEmpleado(Empleado e) throws SQLException
    {
        //ResultSet rs= sentencia.executeQuery("select * from usuario");
        
        Connection con= null;
        Statement smt;
        ResultSet res;
        try{
        String consulta= "INSERT INTO Empleado VALUES( +"+ null
                                                        + e.getNombre()+ ","
                                                        + e.getApe_Paterno()+ ","
                                                        + e.getApe_Materno()+ ","
                                                        + null
                                                        + e.getNss() + ","
                                                        + e.getCalle()+ ","
                                                        + e.getColonia() + ","
                                                        + e.getNum_exterior()+ ","
                                                        + e.getNum_interior()+ ","
                                                        + e.getTel()+ ","
                                                        + e.getFe_ingreso()+ "')";
            smt = con.createStatement();
            smt.executeQuery(consulta);
            smt.executeUpdate(consulta);
        }catch(Exception ex){
            System.out.println("Error desconocido:" + ex.getMessage());
        }
        }
     
   
     
    
}
